﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MvcEngine.LinqToSqlProvider;

namespace Akronus.TaskScheduler.LinqLogger
{
    public class TaskLogDataService : Repository, ITaskLog
    {
        public void Add(string message)
        {
            Add(message, LogPriority.Low);
        }

        public void Add(string message, string priority)
        {
            MvcEngine.Core.Helpers.LogHelper.Current.WriteInfo(message);
            //TaskLog log = new TaskLog() { Id = Guid.NewGuid(), Date = DateTime.Now, Message = message, Priority = priority };
            //using (var contextManager = CreateContextManager(false))
            //{
            //    contextManager.Context.TaskLogs().InsertOnSubmit(log);
            //    contextManager.Commit();
            //}
        }
    }
}
